﻿<%@ Page Title="Estimate" Language="C#" MasterPageFile="~/Pages/Site.Master" AutoEventWireup="true" Inherits="GMS.Pages_Estimate" Codebehind="Estimate.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {

            $.simplePrint = function (selector) {
                // Crea un nuevo elemento iframe
                printArea = document.createElement('iframe');

                // Applies styles to hide the item set
                $(printArea).attr({ style: 'border:0;position:absolute;width:0px;height:0px;left:0px;top:0px;' });

                // Add the element to document
                document.body.appendChild(printArea);

                // Applies the content
                printArea.doc = printArea.contentWindow.document;

                // Starts the document, writes data and closes
                printArea.doc.open();
                printArea.doc.write($(selector).html());
                printArea.doc.close();

                // Focuses on the item and print launches
                printArea.contentWindow.focus();
                printArea.contentWindow.print();

                // Return
                return false;

                // Remove the element to document
                document.body.removeChild(printArea);
            }

            $("#btnPrint").click(function () {
                $.simplePrint('#printme');
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="printme" class="container">
        <div>
            <h2>
                Your Customized Estimate
            </h2>    
            <br />
            <p>
                Thank you for using our online estimator.  Based on the information you have provided and the options selected, below is the estimate for your countertop.  Please note that this estimate is non-binding and subject to change. Countertop promotions currently available may reduce your price.  The exact cost of your countertop project can only be provided after our professional installation team has measured your countertop. See store associate for details.
            </p>
            <br />
        </div>
   
   <div class="row">
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div>
        
        
        <div>
            <div class="span5" style="display:inline-block;width:420px;height:250px">
                <div>
                  <p><strong>Quote Id: </strong>
                    <asp:Label ID="lblUserId" runat="server" />
                    </p>  
                </div>
                <br />
                <div style="display:inline-block;vertical-align:middle;">
                    <asp:Image ID="imgStoneImage" runat="server" />
                    <asp:Button ID="btnEditStone" Text="Edit" runat="server" OnClick="btnEditStone_Click" Width="100" CssClass="btn-edit center"/>
                </div>
                <div style="display:inline-block;vertical-align:middle;">
                    <strong>Material: </strong>
                    <asp:Label ID="lblMaterial" runat="server" />
                    <br />
                    <br />
                    <strong>Origin: </strong>
                    <asp:Label ID="lblOrigin" runat="server" />
                    <br />
                    <br />
                    <strong>Thickness: </strong>
                    <asp:Label ID="lblThickness" runat="server" />
                    <br />
                    <br />
                    <strong>Stone Type: </strong>
                    <asp:Label ID="lblStoneType" runat="server" />
                    <br />
                    <br />
                    <strong>Price Group: </strong>
                    <asp:Label ID="lblPriceGroup" runat="server" />
                </div>
            </div>
            <div style="display:inline-block;vertical-align:top;margin-left:20px;margin-top:15px;width:520px;">
                <table class="no-lines">
                    <tr>
                        <td><asp:Button ID="btnSurface" runat="server" Text="Edit" CssClass="btn-edit" OnClick="btnSurface_Click"/></td>
                        <td class="lbl-item "><strong>Shape Dimensions: </strong></td>
                        <td class="lbl-qty"><asp:Label ID="lblSurface" runat="server" /> sq. ft.</td>
                        <td>=</td>
                        <td class="lbl-cost">$ <asp:Label ID="lblSurfaceDollars" runat="server" /></td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="btnBackSplash" Text="Edit" runat="server" CssClass="btn-edit" OnClick="btnBackSplash_Click" /></td>
                        <td class="lbl-item"><strong>4" Backsplash: </strong></td>
                        <td class="lbl-qty"><asp:Label ID="lblBS" runat="server" /> sq. ft.</td>
                        <td>=</td>
                        <td class="lbl-cost" >$ <asp:Label ID="lblBSDollars" runat="server"/></td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="btnEdge" Text="Edit" runat="server" CssClass="btn-edit" OnClick="btnEdge_Click" /></td>
                        <td class="lbl-item"><strong><asp:Label ID="lblEdgeType" runat="server" /></strong></td>
                        <td class="lbl-qty"><asp:Label ID="lblEdgeLength" runat="server" /> linear ft</td>
                        <td>=</td>
                        <td class="lbl-cost" >$ <asp:Label ID="lblEdgeDollars" runat="server" /></td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="btnSinkCut" Text="Edit" runat="server" CssClass="btn-edit" OnClick="btnSinkCut_Click" /></td>
                        <td class="lbl-item"><strong>Sink cut-outs: </strong></td>
                        <td class="lbl-qty"><asp:Label ID="lblSinkCutOutsQt" runat="server" /> qt</td>
                        <td>=</td>
                        <td class="lbl-cost" >$ <asp:Label ID="lblSinkCutDollars" runat="server" /></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td class="lbl-item"><strong>Zip Code Surcharge: </strong></td>
                        <td class="lbl-qty"><asp:Label ID="lblZipDistance" runat="server" /> miles</td>
                        <td>=</td>
                        <td class="lbl-cost" ><asp:Label ID="lblZipSurcharge" runat="server" /></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td class="lbl-item"><strong>Tax: </strong></td>
                        <td class="lbl-qty"><asp:Label ID="lblTax" runat="server" />%</td>
                        <td>=</td>
                        <td class="lbl-cost" >$ <asp:Label ID="lblTaxDollars" runat="server" /></td>
                    </tr>
                </table>
                <br /><br />
                <div>
                    <div style="font-size:18px;font-weight:bold;">
                        <strong>Your Countertop Estimate: </strong>
                        <span class="lbl-cost" style="text-align:right;">$ <asp:Label ID="lblCost" runat="server" />*</span>
                    </div>
                    <br />
                    <div>
                        <asp:Repeater ID="rptrStoneCategory" runat="server" OnItemDataBound="rptrStoneCategory_ItemDataBound">
                            <ItemTemplate>
                                <asp:Label ID="lblStoneCategoryId" runat="server" Text='<%# Bind("StoneCategoryId") %>'
                                    Visible="false" />
                                <p>
                                    <span class="lbl-qty"><asp:Label ID="lblStoneCategory" runat="server" Text='<%# Bind("Name") %>' /></span>
                                    Estimated Range:
                                    <asp:Label ID="lblStoneCategoryPrice" runat="server" />
                                </p>
                            </ItemTemplate>
                        </asp:Repeater>
                    </div>
                </div>
            </div>
            <div>
                <p>
                    This estimate is non-binding and subject to change. Countertop promotions currently
                    available may reduce your estimate. Your exact cost will be calculated by a Kitchen
                    Designer from The Granite & Marble Specialties after a measurement by a professional installer. Minimums
                    may apply. Please see your local store associate for details.</p>
            </div>
            <div class="well" style="text-align: right;">
                <asp:Button ID="btnBack" CssClass="btn primary" runat="server" Text="Back" OnClick="btnBack_Click" />
                <asp:Button ID="btnEmail" CssClass="btn primary" runat="server" Text="Email" OnClick="btnEmail_Click" />
               <%-- <input id="btnPrint"  type="button" value="Print" class="btn primary" />--%>
            </div>
        </div>
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
    </div>
    
</asp:Content>
